package scm;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class InfoWindow
{
    private JFrame parent;
    private JDialog d;
    private JLabel dialLab;

    public InfoWindow(JFrame frame)
    {
        d = new JDialog(frame, "Informacje o programie", true);
        d.setSize(new Dimension(655, 320));
        d.setLocation(250,250);
	d.setLayout(new BorderLayout());
        d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        fillForm();
        d.setVisible(true);
        this.parent = frame;
    }

    // wypełnia okno dialogowe
    private void fillForm()
    {
         // komponenty okna dialogowego
         dialLab = new JLabel("<html><center><FONT SIZE=8>IT Service Continuity Management</FONT>" +
                              "<br><FONT SIZE=5>Autorzy: Adrian Chudziński, Przemysław Gospodarczyk, Łukasz Synówka</FONT>" +
                              "<br><FONT SIZE=6>ITIL 2010</FONT></center></html>", JLabel.CENTER);
         dialLab.setHorizontalTextPosition(JLabel.CENTER);
         dialLab.setVerticalTextPosition(JLabel.CENTER);
         
         JButton dialButtOK = new JButton("OK");

         d.setLayout(new GridLayout(3,1));
         d.add(new JLabel(new ImageIcon("itil.jpg")));
         d.add(dialLab);
         d.add(dialButtOK);
         dialButtOK.addActionListener(alHelp);
    }

    // Action Listener dla modalnego okna dialogowego pomocy
    public ActionListener alHelp = new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            d.dispose();
        }
    };


}
